package control

abstract class Control <T> {
    
    //This message must be updated if a validation fails.
    String message
    
    /* 
     * These methods are wrappers for the ones found in the DAO class.
     * They must first validate the data using the validateFields() method (if
     * necessary) and if it succeeds, create a connection and 
     * perform the operation.
     */
    
    protected abstract Boolean validateFields(T object)
    
    abstract Integer create(T object)
    
    abstract Boolean remove(T object)
    
    abstract Boolean update(T object)
    
    abstract T find(Integer id)
    
    abstract List findAll()
    
    abstract List select(T object)
}

